package com.hb.core.pojo.enums;

import lombok.Getter;

/**
 * @author yuezheng
 */
@Getter
public enum SmsTypeEnum {

    TENDERREGISTER(1, "SMS_239310250", "招标人注册审核通过","BiddingRegisterServiceImpl"),
    REGISTER(2, "SMS_239310250", "投标人注册","TenderRegisterServiceImpl"),
    INVITATION(3, "SMS_239320218", "邀请书编辑","InvitationReleaseServiceImpl"),
    NOTICE(4, "SMS_239320222", "公告编辑","NoticeReleaseServiceImpl"),
    REGISTRATION(5, "SMS_243995908", "投标人报名","TenderEnrollServiceImpl"),
    SALE(6, "SMS_239320225", "标书发售","TenderSaleServiceImpl"),
    MARGIN(7, "SMS_239320227", "投标人递交保证金","SubmitBondServiceImpl"),
    OPENING(8, "SMS_239325243", "开标提醒","BidOpeningReminderServiceImpl"),
    PUBLICITY(9, "SMS_239325244", "中标候选人公示","PublishCandidate"),
    RESULT(10, "SMS_239315271", "中标结果公告","ReleaseBidWinResultServiceImpl"),
    QUESTION(11, "SMS_239320232", "质疑提醒","ProblemSendServiceImpl"),
    APPROVED(12, "SMS_239310264", "审核通过","PassExamineServiceImpl"),
    NOTAPPROVED(13, "SMS_239325255", "审核未通过","FailExamineServiceImpl"),
    QUOTE(14, "SMS_239310266", "报价提醒","SecQuoBidInfoServiceImpl"),
    FINISH(15, "SMS_239310267", "报价结束提醒","SecQuoBidInfoServiceImpl"),
    ;


    /**
     *
     *
     * @author yuezheng
     * @param code 类型
     * @param code 短信模版code
     * @param showName 标题
     * @return
     * @date 2022/4/17 5:19 PM
     */
    SmsTypeEnum(int code, String template, String showName, String service) {
        this.code = code;
        this.template = template;
        this.showName = showName;
        this.service = service;
    }


    /**
     * 通过type取枚举
     * @param code
     * @return
     */
    public static SmsTypeEnum getTypeByValue(Integer code){
        if (code == null){
            return null;
        }
        for (SmsTypeEnum enums : SmsTypeEnum.values()) {
            if (enums.getCode() == code) {
                return enums;
            }
        }
        return null;
    }

    private final int code;
    private final String template;
    private final String showName;
    private final String service;
}
